package com.tanhua.model.vo;

import com.tanhua.model.domain.Questions;
import com.tanhua.model.domain.TestSoul;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class TestSoulVo implements Serializable {

    private String id;
    /**
     * 问卷名称
     */
    private String name;
    /**
     * 问卷封面
     */
    private String cover;
    /**
     * 问卷级别
     */
    private String level;
    /**
     * 问卷星级
     */
    private Integer star;

    /**
     * 问卷题目数量
     */
    private int num;

    private Integer isLock = 0;

    private String reportId;//最新报告

    private List<Questions> questions = Collections.emptyList();

    public static TestSoulVo init(TestSoul testSoul) {
        TestSoulVo vo = new TestSoulVo();
        vo.setId(testSoul.getId().toString());
        vo.setName(testSoul.getName());
        vo.setCover(testSoul.getCover());
        vo.setLevel(testSoul.getLevel());
        vo.setStar(testSoul.getStar());
        vo.setNum(testSoul.getNum());
        return vo;
    }


}
